from numpy import random


class Generator:
    def gen(self, n=5, times=None):
        if times == None:
            times = random.randint(1, n+1)
        al = []
        for i in range(97,123):
            al.append(chr(i))

        c = random.choice(al)
        re = [c for i in range(n)]

        for i in range(times):
            begin = random.randint(0, n-1)
            end = random.randint(begin, n)
            c = random.choice(al) 
            for j in range(begin, end+1):
                re[j] = c

        re = "".join(re)
        return re


if __name__ == '__main__':
    a = Generator()
    r = a.gen(15)
    print(r)